package com.yz.forlogin.system.controller;

import com.yz.forlogin.security.entity.CurrentUser;
import com.yz.forlogin.system.service.UserService;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author shuang.kou
 */
@RestController
@RequestMapping("/user")
public class UserController {

    private final UserService userService;

    private final CurrentUser currentUser;

    @RequestMapping(value = "/registerCustomer",method = RequestMethod.GET)
    public void registerCustomer(@RequestParam Map<String,String> map){
        userService.saveUser(map);
    }

    @RequestMapping(value = "/registerAdmin",method = RequestMethod.GET)
    public void registerAdmin(@RequestParam Map<String,String> map){
        userService.saveAdmin(map);
    }


    public UserController(UserService userService, CurrentUser currentUser) {
        this.userService = userService;
        this.currentUser = currentUser;
    }


}
